import React, { Suspense } from 'react'
import ReactDOM from 'react-dom'
import { BrowserRouter } from 'react-router-dom'
import './index.css'

import App from './App'
import './utils/rem-config'
import Loading from './component/Loading'
import { Provider } from 'react-redux'
import store from './redux/store'

//组件懒加载之后必须要用suspended把所有的组件包裹起来
ReactDOM.render(<Provider store={store}>
    <Suspense fallback={<Loading />}>
        <BrowserRouter>
            <App />
        </BrowserRouter>
    </Suspense>
</Provider>, document.getElementById('root'))